/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package persistence.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author sidy
 */
@Entity
@Table(name = "usager")
public class Usager implements Serializable{
     
    @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name ="id", nullable = false,unique = true)
    private Integer id;
    
    @Column(name ="nom")
    private  String nom;
    
    @Column(name ="prenom")
    private String prenom;
    
    @Column(name ="adresse")
    private String adresse;
    
    @OneToMany(mappedBy = "usager")
    private List<Reservation> reservations;

    public Usager() {
    }

    public Usager(String nom, String prenom, String adresse) {
        this.nom = nom;
        this.prenom = prenom;
        this.adresse = adresse;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public String getAdresse() {
        return adresse;
    }

    public void setAdresse(String adresse) {
        this.adresse = adresse;
    } 
}
